# 异常

# 发出异常
# raise Exception
# raise ArithmeticError


# 自定义异常
class MyException(Exception): pass


# raise MyException

# 捕获异常

try:
    raise MyException
except MyException as e:
    print("catch MyException")

# 没有异常的处理
try:
    pass
except MyException as e:
    print("catch MyException")
else:
    print("No MyException")

# 必须最后执行
try:
    pass
except MyException as e:
    print("catch MyException")
else:
    print("No MyException")
finally:
    print("final MyException")

#
